<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
	Update Advertiser Data
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>

<div id="content" class="box">
	<h1>Update Advertiser Data</h1>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
		<fieldset>
			<legend>Update Advertiser Data</legend>
		<?php if (isset($errors)) 
				{
					foreach ($errors as $error)
					{
		?>
				<p class="msg error"><?php echo $error;?></p>
		<?php		}
				}
		?>
			<form method="post" action="<?php echo url('advertiserdata/edit');?>">
				<input type="hidden" name="id" value="<?php echo isset($data['id']) ? $data['id'] : '';?>"/>
				<dl>
					<dt><label>Date:</label></dt>
					<dd>
						<input type="text" name="date"  value="<?php echo isset($data['data_time']) ? $data['data_time'] : '';?>" id="date" />
					</dd>
				</dl>
				<dl>
					<dt><label>Advertiser:</label></dt>
					<dd>
						<?php
							 echo Util::buildDropDownList(
							 	array('id'=>'advertiser', 'name'=>'advertiser'),
							 	$advertisers,
							 	isset($data['advertiser_id']) ? $data['advertiser_id'] : false,
							 	array('k'=>'', 'l'=>'--All--')
							 );
						?>
					</dd>
				</dl>
				<dl>
					<dt><label>Site:</label></dt>
					<dd>
						<?php
							 echo Util::buildDropDownList(
							 	array('id'=>'site', 'name'=>'site'),
							 	$sites,
							 	isset($data['site_id']) ? $data['site_id'] : false,
							 	array('k'=>'', 'l'=>'--All--')
							 );
						?>
					</dd>
				</dl>
				<dl>
					<dt><label>Placement:</label></dt>
					<dd>
						<select name="placement">
							<option value="Short Reg Coreg" <?php echo (isset($data['placement']) && $data['placement'] == 'Short Reg Coreg') ? 'selected=selected':''; ?>>Short Reg Coreg</option>
							<option value="Full Reg Coreg" <?php echo (isset($data['placement']) && $data['placement'] == 'Full Reg Coreg') ? 'selected=selected':''; ?>>Full Reg Coreg</option>
							<option value="Profile Update Coreg" <?php echo (isset($data['placement']) && $data['placement'] == 'Profile Update Coreg') ? 'selected=selected':''; ?>>Profile Update Coreg</option>
							<option value="Confirmation Coreg" <?php echo (isset($data['placement']) && $data['placement'] == 'Confirmation Coreg') ? 'selected=selected':''; ?>>Confirmation Coreg</option>
							<option value="Offer Wall" <?php echo (isset($data['placement']) && $data['placement'] == 'Offer Wall') ? 'selected=selected':''; ?>>Offer Wall</option>
						</select>
					</dd>
				</dl>
				<dl>
					<dt><label>Click:</label></dt>
					<dd><input type="text" name="click" value="<?php echo isset($data['click']) ? $data['click'] : '';?>"/></dd>
				</dl>
				<dl>
					<dt><label>Revenue:</label></dt>
					<dd><input type="text" name="revenue" value="<?php echo isset($data['revenue']) ? $data['revenue'] : '';?>"/></dd>
				</dl>
				<input type="submit" value="Update Advertiser Data" /> 
			</form>
		
		</fieldset>
		
</div>
<script type="text/javascript">
	$(function(){
		$('#date').datepicker({ "dateFormat": 'yy-mm-dd'});
	});
</script>
<?php $this->_endblock(); ?>